package com.plian.system.controller.bt.baseinfo;

import com.plian.Tools.base.BaseController;
import com.plian.Tools.pagedata.PageData;
import com.plian.system.annotation.LogOperation;
import com.plian.system.model.ListResult;
import com.plian.system.model.ObjResult;
import com.plian.system.service.bt.baseinfo.BaseInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 基础数据
 */
@RestController
@RequestMapping(value = "api/baseinfo")
public class BaseInfoController extends BaseController {
    @Autowired
    BaseInfoService baseInfoService;
    @PostMapping(value = "/list")
    public ListResult list(@RequestBody PageData pd) throws Exception {
        return baseInfoService.list(pd);
    }
    @PostMapping(value = "/save")
    @LogOperation("基础数据-新增")
    public ObjResult save(@RequestBody PageData pd){
        return baseInfoService.save(pd);
    }
    @PostMapping(value = "/edit")
    @LogOperation("基础数据-编辑")
    public ObjResult edit(@RequestBody PageData pd){
        return baseInfoService.edit(pd);
    }
    @PostMapping(value = "/del_ids")
    @LogOperation("基础数据-删除")
    public ObjResult del_ids(@RequestBody PageData pd){
        return baseInfoService.del_ids(pd);
    }
    @PostMapping(value = "/findbyid")
    public ObjResult findid(@RequestBody PageData pd){
        return baseInfoService.findbyid(pd);
    }
    @PostMapping(value = "/findbyParentid")
    public ObjResult findbyParentid(@RequestBody PageData pd){
        return baseInfoService.findbyParentid(pd);
    }
}